{{ define "header" }}
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Hello</title>
	<link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>
	<div class="nav-container">
		<ul class="layui-nav layui-container" lay-filter="">
			<li class="layui-nav-item">畅所欲言</li>
			<li class="layui-nav-item"><a href="/">最新发布</a></li>
			{{ if .userInfo.Id }}
				<li class="layui-nav-item">
					<a href="/space">{{ .userInfo.Name }}</a>
				</li>
				<li class="layui-nav-item"><a href="/logout">退出</a></li>
			{{ else }}
				<li class="layui-nav-item"><a href="/login">登录</a></li>
				<li class="layui-nav-item"><a href="/register">注册</a></li>
			{{ end }}
		</ul>
	</div>
	<br>
{{ end }}
{{ define "head" }}
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Hello</title>
	<link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>
{{ end }}
{{ define "footer" }}
</body>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script>
	//注意：导航 依赖 element 模块，否则无法进行功能性操作
	layui.use('element', function(){
	var element = layui.element;

	});
</script>
</html>
{{ end }}
{{ define "user-nav-left" }}
<!-- 个人信息 -->
<div class="space-box space-userinfo">
	<div class="space-title">
		{{ .titlePrefix }}的信息
	</div>
	<div class="space-info">
		<div class="space-avatar">
			<img src="{{ .userInfo.Avatar }}">
		</div>
		<div class="space-userinfo">
			<p>{{ .userInfo.Name }}</p>
			{{ if not .other }}
			<ul class="user-nav">
				<li class="user-nav-item">
				    <a href="/friends">
				    	{{ .titlePrefix }}的好友
				    	{{ if .friendsNumber }}({{ .friendsNumber }}){{ end }}
				    </a>
				</li>
				<li class="user-nav-item">
				    <a href="/message">
					    {{ .titlePrefix }}的消息 
					    {{ if .messageNumber }}
					    <font color="red">({{ .messageNumber }})</font>
					    {{ end }}
					</a>
				</li>
				<li class="user-nav-item">
				    <a href="/profile">个人信息</a>
				</li>
				<li class="user-nav-item">
				    <a href="/password">修改密码</a>
				</li>
			</ul>
			{{ end }}
		</div>
	</div>
</div>
<!-- 访问统计 -->
<div class="space-box space-stat">
	<div class="space-title">
		访问统计
	</div>
	<div class="space-info">
		<div class="stat-item">
			<p>今天：{{ .today }}人</p>
			<p>近一周：{{ .week }}人</p>
			<p>近一月：{{ .month }}人</p>
			<p>最后登录：{{ .lastTime }}</p>
		</div>
	</div>
</div>
{{ end }}